package com.devunion.salon.persistence;

import javax.persistence.*;

/**
 *
 CREATE TABLE `serv_emp` (
   `id` int(11) NOT NULL auto_increment,
   `service_id` int(11) NOT NULL default '0',
   `employee_id` int(11) NOT NULL default '0',
   `price` decimal(10,3) default NULL,
   `duration` int(11) default NULL,
   `taxes` decimal(10,3) default NULL,
   PRIMARY KEY  (`id`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
 *
 * @author Viktar Liaskovich
 */
@Entity
@Table(name = "service2employee")
public class Service2Employee extends BasePersistentObject{

    @ManyToOne(cascade = {CascadeType.ALL})
    private Service service;

    @ManyToOne(cascade = {CascadeType.ALL})
    private Employee employee;

    @Column(name = "price", nullable = true)
    private Float price;

    @Column(name = "duration", nullable = true)
    private Integer duration;

    @Column(name = "taxes", nullable = true)
    private Float taxes;

    public Service getService() {
        return service;
    }

    public void setService(Service service) {
        this.service = service;
    }

    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    public Float getTaxes() {
        return taxes;
    }

    public void setTaxes(Float taxes) {
        this.taxes = taxes;
    }
}
